<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>审核信息</title>
	</head>
	<link rel="stylesheet" href="../css/common.css" />
	<style>
		body{
			background:#f1f1f1;
		}
		#box{
			width:330px;
			text-align:right;
			margin-top:40px;
		}
		input[type=text]{
			width:200px;
			height:23px;
			text-align:left;
			border-radius:2px;
			border:1px solid #dadada;
			padding-left:10px;
		}
		input[type=radio]{
			position:relative;
			top:4px;			
		}
		button{
			width:100px;
			height:28px;
			border:none;
			border-radius:2px;
			background:#00aa98;
			outline:none;
			color:white;
			cursor:pointer;
		}
		.title{
			margin-top:10px;
		}
		.btnTit{
			margin-top:40px;
		}
		.cancel{
			background:#a1a4a9;
			margin-left:7px;
		}
		
		.audit{
			position:relative;
			left:-3px;
			top:5px;
		}
	</style>
	<body>	
		<div id="box">									
			<div class="title">
				<label>结算单价</label>
				<input class="settlePrice" type="text"/>
			</div>
			<div class="title">
				<label>报价单价</label>
				<input class="price" type="text"/>
			</div>
			<div class="title">
				<label>结算儿童价</label>
				<input class="childPrice" type="text"/>
			</div>
			<div class="title">
				<label>报价儿童价</label>
				<input class="viewChildPrice" type="text"/>
			</div>
			<div class="title">
				<label>结算婴儿价</label>
				<input class="infantPrice" type="text"/>
			</div>
			<div class="title">
				<label>报价婴儿价</label>
				<input class="viewInfantPrice" type="text"/>
			</div>
			<div class="title auditMenu">
				<label style="margin-right:2px;">审核结果</label>
				<span style="margin-right:15px;"><input class="result" type="radio" value='true' name="audit" checked/> 通过</span>
				<span style="margin-right:85px;"><input class="result" type="radio" value='false' name="audit"/> 不通过</span>
			</div>
			<div class="title">
				<label>审核意见</label>
				<input class="remark" type="text"/>
			</div>
			<div class="title btnTit">
				<button class="sure">确认</button>
				<button class="cancel">取消</button>
			</div>
		</div>
		<script type="text/javascript" src="../js/jquery-1.12.4.js" ></script>	
		<script type="text/javascript" src="../layer-v2.4/layer/layer.js" ></script>	
		<script type="text/javascript" src="../js/common.js" ></script>
		<script>
			
			$(".sure").click(function(){
				var orderId = getHref().orderId;
				var postData = getData();
				checkOut(postData);
				layer.load(3,{shadeClose:true});//加载层；
				$.ajax({
					type:"post",
					url:"../order/"+orderId+"/charter/sk/audit?temp="+Math.random(),
					contentType:'application/json;charset=utf-8',
					dataType:"json",
					data:JSON.stringify(postData),
					success:function(data){
						layer.closeAll();
						if(data.status==1001){
							layer.msg("审核成功",{icon:1},function(){
								closeWin();
							})
						}else{
							layer.alert("审核失败"+data.data)
						}
					}
				})
			})
			//获取数据
			function getData(){
				var postData = {};
				postData.settlePrice = $(".settlePrice").val();
				postData.price = $(".price").val();
				postData.childPrice = $(".childPrice").val();
				postData.viewChildPrice = $(".viewChildPrice").val();
				postData.infantPrice = $(".infantPrice").val();
				postData.viewInfantPrice = $(".viewInfantPrice").val();
				postData.result = $(".result:checked").val();
				postData.remark = $(".remark").val();
				return postData;
			}
			//校验
			function checkOut(postData){
				inputCheckoutFun.price.normal(postData.settlePrice,"结算单价","为数字，最多保留两位小数")
				inputCheckoutFun.price.normal(postData.price,"报价单价","为数字，最多保留两位小数")
				inputCheckoutFun.price.normal(postData.childPrice,"结算儿童价","为数字，最多保留两位小数")
				inputCheckoutFun.price.normal(postData.viewChildPrice,"报价儿童价","为数字，最多保留两位小数")
				inputCheckoutFun.price.normal(postData.infantPrice,"结算婴儿价","为数字，最多保留两位小数")
				inputCheckoutFun.price.normal(postData.viewInfantPrice,"报价婴儿价","为数字，最多保留两位小数")
				inputCheckoutFun.Empty(postData.remark,"备注","不能为空")
			}
			$(".cancel").click(function(){
				closeWin();
			})
		</script>
	</body>
</html>
